package ch.exm.storm.query.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

class FactorySessionProvider implements SessionProvider {
	
	private SessionFactory sessionFactory;
	private Session session;
	
	public FactorySessionProvider(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
		session = this.sessionFactory.openSession();
	}

	public Session provideSession() {
		return session;
	}

	public void disposeSession(Session session) {
//		session.close();
	}
}
